/*
** ADOBE SYSTEMS INCORPORATED
** Copyright 2012 Adobe Systems Incorporated
** All Rights Reserved.
**
** NOTICE:  Adobe permits you to use, modify, and distribute this file in accordance with the
** terms of the Adobe license agreement accompanying it.  If you have received this file from a
** source other than Adobe, then your use, modification, or distribution of it requires the prior
** written permission of Adobe.
*/
#include <stdio.h>
#include <iostream>
#include <fstream>

using namespace std;

int main(int argc, char **argv)
{
    std::fstream f1,f2,f3,f4;

    f1.open("flascclogo.txt");
    while (f1.good()) {
    	string line;
      	getline (f1,line);
      	cout << line << endl;
    }

    f2.open("rocks.txt");
    while (f2.good()) {
    	string line;
      	getline (f2,line);
      	cout << line << endl;
    }

    f3.open("/web/remote.txt");
    while (f3.good()) {
    	string line;
      	getline (f3,line);
      	cout << line << endl;
    }

    int count = 0;
    f4.open("/local/counter.txt", ios::in);
    if (f4.is_open()) {
        f4 >> count;
        f4.close();
    }
    cout << "You have run this sample " << ++count << " times";
    f4.open("/local/counter.txt", ios::out);
    f4 << count;
    f4.close();

    return 0;
}
